package org.springblade.modules.admin.vo.parts;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.util.List;

/**
 * @Date 9:41 2022/5/18
 * @Description {
 *   维修部件 tree
 * }
 * @Author lsay
 **/
@Data
public class MalfunctionPartsTreeVO {

	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	private String name;

	@JsonSerialize(using = ToStringSerializer.class)
	private Long parentId;


	private Integer weight = 10;

	private List<MalfunctionPartsTreeVO> children;


	public void setChildren(List<MalfunctionPartsTreeVO> children) {
		if(children.size() == 0){
			this.children = null;
		}else{
			this.children = children;
		}

	}

}
